﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>USER LOGIN</title>
		<%@ include file="/share/include.jsp" %>
		<!-- <script src="js/jquery.min.js"></script> -->
		<link rel="stylesheet" href="<%=basePath %>/css/login.css" type="text/css"></link>
   		 <meta name="viewport" content="width=device-width, initial-scale=1">
		 <script type="application/x-javascript"> 
			addEventListener("load", function() { 
				setTimeout(hideURLbar, 0); 
			}, false); 
			function hideURLbar(){ 
				window.scrollTo(0,1); 
			} 
		</script>
		<script type="text/javascript">
			function submitForm(id){
				var url = '${root }/control/user/userController/login.do';
				var param = $('#'+id).serialize();
				$.post(url,param,function(msg){
					if(msg.indexOf("success") > 0){
						msg = msg.substring(0, msg.length - 7);
						window.location.href = '${root}/control/user/userController/displayUser.do?userId='+msg;
						//window.location.href = '${root}/control/user/userController/displayUserCenter.do?userId='+msg;
					}else {
						alert(msg);
					}
				});
			}
		</script>
	</head>
	<body>
		<!-- container -->
		<!-- header -->
		<div class="header">
			<%@ include file="/control/jsp/layout/header.jsp" %>
			<!-- /bottom-header -->
		</div>
		<!-- header -->
		<!--- top-nav -->
			<%@ include file="/control/jsp/layout/indexMenu.jsp" %>
		<!--- top-nav -->
		<!-- script-for-nav -->
		<script>
			$(document).ready(function(){
				//注册成功后弹出提示
				var registerFalg = '${registerFalg}';
				if(registerFalg != null && registerFalg != '' && registerFalg == 'success'){
					artDalog('prompt','Registration is successful, welcome to login the user registration email to activate account',null);
				}else if(registerFalg != null && registerFalg != '' && registerFalg != 'success'){
					artDalog('prompt',registerFalg,null);
				}
				//激活帐号后弹出提示
				var accountFalg = '${accountFalg}';
				if(accountFalg != null && accountFalg != ''){
					artDalog('prompt',accountFalg,null);
				}
			});
		</script>
			
		<!-- /script-for-nav -->
		<!-- Product-Details-page -->
		<div class="details-page">
			<div class="content details-page">
				<div class="product-details">
					<div class="container">
						<div class="details-left" style="width: 70%;">
							<h3 style="color: orangered;">USER LOGIN</h3>
							<form id="login" action="" method="post">
								<h1>Log In</h1>
								<fieldset id="inputs">
									<input id="userName" type="text" name="userName" placeholder="Username" value="testUser" autofocus required>   
									<input id="password" type="password" name="password" placeholder="Password" value="123456" required>
								</fieldset>
								<fieldset id="actions">
									<input type="button" id="submit" value="Log in"  onclick="submitForm('login');">
									<a href="${root}/control/layoutController/displayUserFindPassword.do?${cityValue }">Forgot your password?</a>
									<a href="${root }/control/layoutController/displayUserRegister.do?${cityValue }">Register</a>
								</fieldset>
								<p class="back">If you don't want to login, temporarily can browse the first domestic outfit web site&nbsp;&nbsp;<input type="button" class="btn2 p-btn" onClick="location.href='${root }/control/layoutController/displayIndex.do?${cityValue }'" style="cursor:pointer;" value="Browse the web site" /></p>
							</form>
							
							<!-- BSA AdPacks code -->
							<!-- <script src="http://code.jquery.com/jquery-1.6.3.min.js"></script> -->
							<script>
							(function(){
							  var bsa = document.createElement('script');
								 bsa.async = true;
								 bsa.src = '${root}/js/login.js';
							  (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
							})();
							</script>
						</div>
						<div class="details-right" style="width: 29%;">
						  
						</div>
						<div class="clearfix"> </div>
					</div>
			    </div>
		    </div>
		</div>
		<!-- /Product-Details-page -->
		<!-- footer -->
		<%@ include file="/control/jsp/layout/footer.jsp" %>
</body>
</html>

